package com.hsq.pojo;

public class ClientRequest {
    private Integer id;
    private String name;
    private Integer requestType;
    private String requestUrl;
    private String requestHeaders;
    private Integer bodyType;
    private String body;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getRequestType() {
        return requestType;
    }

    public String getRequestTypeStr() {
        if (requestType == null) {
            return "未选择";
        }

        if (requestType == 1) {
            return "GET";
        } else if (requestType == 2) {
            return "POST";
        }
        return "未选择";
    }

    public void setRequestType(Integer requestType) {
        this.requestType = requestType;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    public String getRequestHeaders() {
        return requestHeaders;
    }

    public void setRequestHeaders(String requestHeaders) {
        this.requestHeaders = requestHeaders;
    }

    public Integer getBodyType() {
        return bodyType;
    }

    public String getBodyTypeStr() {
        if (bodyType == null) {
            return "未选择";
        }
        if (bodyType == 1) {
            return "FORM";
        } else if (bodyType == 2) {
            return "JSON";
        }
        return "未选择";
    }

    public void setBodyType(Integer bodyType) {
        this.bodyType = bodyType;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "ClientRequest{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", requestType=" + requestType +
                ", requestUrl='" + requestUrl + '\'' +
                ", requestHeaders='" + requestHeaders + '\'' +
                ", bodyType=" + bodyType +
                ", body='" + body + '\'' +
                '}';
    }
}
